package com.mindao.app.weixin.model;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;

 


import com.mindao.app.common.spring.model.BaseModel;

/**
/* 版权所有： 广州敏道科技有限公司
/*
/* 功能描述：微信永久素材
/*
/* 创 建 人：李国才
/* 创建时间：2016年7月17日 下午7:59:18 	
 **/
@Entity
@Table(name = "weixin_mp_material")
public class WxmpMaterial extends BaseModel{
	private String type;
	private String media_id;
	//非图文类型（图片、语音、视频）的名称
	private String name;//图文消息时存放所有图文消息title，逗号隔开
	//非图文类型（图片、语音、视频）的url
	private String url;
	//素材更新时间
	private String update_time;
	
	//下载时间
	private Date downloadTime;
	
	private List<WbmpNewsItem> newsItems=new ArrayList<>();
	
	
	public String getMedia_id() {
		return media_id;
	}
	public void setMedia_id(String media_id) {
		this.media_id = media_id;
	}
	public String getName() {
 
		return name;
		
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getUpdate_time() {
		return update_time;
	}
	public void setUpdate_time(String update_time) {
		this.update_time = update_time;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
 
	public WxmpMaterial(String type,String media_id, String name, String url,
			String update_time, Date downloadTime) {
		super();
		this.type=type;
		this.media_id = media_id;
		this.name = name;
		this.url = url;
		this.update_time = update_time;
		this.downloadTime = downloadTime;
	}
	
	public WxmpMaterial(){
		super();
	}
	public WxmpMaterial(String type,String media_id, String update_time,
			Date downloadTime) {
		// TODO Auto-generated constructor stub
		super();
		this.type=type;
		this.media_id = media_id;
		this.update_time = update_time;
		this.downloadTime = downloadTime;
	}
	public Date getDownloadTime() {
		return downloadTime;
	}
	public void setDownloadTime(Date downloadTime) {
		this.downloadTime = downloadTime;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	@OneToMany 
	@JoinColumn(name = "material_id")
	@OrderBy("id asc")
	public List<WbmpNewsItem> getNewsItems() {
		return newsItems;
	}
	public void setNewsItems(List<WbmpNewsItem> newsItems) {
		this.newsItems = newsItems;
	}
	
	
}
